home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / LAN / NETP.ARJ / NETP.DOC < prev    next >
Text File  |  1992-03-19  |  9KB  |  177 lines

  1.  
  2.                                 NetPrompt 
  3.  
  4.                                Version 1.00
  5.                               F. Brett Platko
  6.  
  7. NetPrompt is a small (under 3K) TSR that dynamically modifies a workstation's 
  8. prompt syntax to show current [FileServer / Volume] names in addition to 
  9. the regular user prompt string.
  10.  
  11. As the user changes the default drive, NetPrompt automatically edits the user's
  12. workstation Master Environment data to reflect the new prompt string. Because
  13. we edit the master environment changes will not be noticed if we are shelled 
  14. from a program, or are running under a secondary command.com. 
  15.  
  16. Usage:
  17.  
  18.    NetPrompt can be started with the following options:
  19.  
  20.       NETP /U     = Unload the NetPrompt program if loaded last. If there
  21.                     is a memory resident program loaded after NetPrompt,
  22.                     the user is notified that NetPrompt could not be unloaded.
  23.                     
  24.       NETP /NI    = NO Introduction Screen. This is handy if NetPrompt is 
  25.                     loaded from a batch file. /NI suppresses the display of 
  26.                     the startup screen.
  27.  
  28.       NETP /P=    = Use optional prompt string. If the user prefers to use
  29.                     a prompt string other than the default "$P$Q$G" they can
  30.                     define it using the /P option. Prompt strings that contain
  31.                     spaces, ie. "THIS IS A PROMPT $P$Q$G" must be contained in 
  32.                     double quotes. 
  33.  
  34. NOTICE: =>   NetPrompt REQUIRES NetWare Shell version 3.22 or later (NETX) to
  35.              operate properly. If you have problems using NetPrompt be sure 
  36.              that you are using NETX for a Shell driver. (NETX is provided 
  37.              with this release of NetPrompt.)
  38.  
  39. This program is released to the public domain as a needed utility and as a 
  40. guide for programers using Omega Point's CodeRunner TSR libraries. The supplied
  41. source code is provided as examples to accessing DOS environment and network
  42. resources. The files contained in thes NetP.Zip file are:
  43.  
  44.       NetP.Exe       NetPrompt Executable Program.
  45.  
  46.       NPD.C          NetPrompt Disposable Data Module.
  47.       NPI.C          NetPrompt Disposable Installation Code Module.
  48.       NPR.C          NetPrompt Resident Code Module.
  49.  
  50.       DONP.Bat       Batch File for Compiling NetP.Exe 
  51.       Netp.Doc       This Document File.
  52.  
  53.       NETX.Com       Novell NetWare Network Shell Version 3.22
  54.  
  55.  
  56. If you have questions are comments on this utility or on the programing code
  57. feel free to reach me on CompuServe 70441,622.
  58.  
  59. Enjoy, 
  60.  
  61. Brett...
  62.  
  63.  
  64.  
  65. Programing Notes:
  66.  
  67. This section covers the programing logic used to create NetP.Exe. This program 
  68. was written using the CodeRunner and Professional Developer Kit libraries from 
  69. Omega Point, Inc. and the Borland C++ complier. 
  70.  
  71. Omega Point Inc. are the developers of a group of TSR libraries for 'C' 
  72. programmers. Their libraries were used extensively in the development of 
  73. NetPrompt. The libraries contain more than 300 functions (most replacing the 
  74. standard Small-Model functions of your C complier) of optimized assembly 
  75. language. OPI libraries work with Turbo-C, Borland C++, Zortech C, TopSpeed
  76. C, and Microsoft C.  
  77.  
  78. OPI's TSR development platform permits the programer to eliminate 
  79. initialization code and data when the program go resident. The TSR resident 
  80. code can be activated by hardware or BIOS level hot-keys, software or 
  81. hardware interrupts, and by system timing events. 
  82.  
  83. For information on CodeRunner libraries you can contact OPI at:
  84.    
  85.       Omega Point, Inc.
  86.       25 Birch Road
  87.       Framingham, MA 01701
  88.       (508) 887-1819
  89.  
  90.  
  91. Program Explanation:
  92.  
  93. CodeRunner libs permit a high degree of TSR size and speed optimization. 
  94. NetPrompt's current TSR size could be compacted to smaller code unfortunately,
  95. at the sacrifice of readability. If this was a commercial program I would not 
  96. be happy unless the TSR resident size was under 2K. I leave it to the 
  97. user/programer to optimize NetPrompt if they wish. 
  98.  
  99. There are three program modules to NetPrompt. The first is the disposable 
  100. data file NPD.c. This file's data (this file contains only data) will
  101. be disposed when the NetPrompt go resident.
  102.  
  103. The data contained in this module is used by the install code (NPI.c) for 
  104. displaying Intro screens, parsing the command line, defining the TSR signature 
  105. block.  The keyword init_data_end marks the end of disposable data when the 
  106. files are linked.
  107.  
  108. The disposable install code module NPI.c first preforms variable initialization,
  109. command line argument parsing, and then displays the intro screen. The rest of 
  110. the main function checks to see if the NetWare shell has been loaded, and 
  111. then checks if the TSR has been loaded before. Main then initializes mEnvSeg 
  112. (the segment of the Master Environment Block where the prompt string is 
  113. located). By examining the value of offset 3 in the Memory Control Block 
  114. belonging to the Env Block, we can get the Env Block size.
  115.  
  116. We then issue the CodeRunner stay resident function and Interrupt trap 
  117. function. The program is now resident. The NetPrompt program operates by 
  118. trapping Interrupt 21 calls. To do this we define a interrupt trap structure 
  119. (trap_rec in NPR.c) that identifies which DOS interrupt to trap. 
  120.  
  121. The resident code module NPR.c contains the meat of the program. This is the
  122. code and data that remains in memory when NetPrompt terminates. This is the 
  123. module that could benefit with optimization. 
  124.  
  125. The function isr21 is called each time a interrupt 21 is detected. This 
  126. function examines the contents of AX to detect if a DOS GetDefaultDiskDrive
  127. (19 Hex) request is made.  If it is not, the interrupt is passed down the 
  128. interrupt chain. If it is a 19H request, a CodeRunner function at_disk_prompt 
  129. determines if the user is at the DOS command prompt. If so, we begin to 
  130. process the Prompt command.
  131.  
  132. The ProcessPrompt function begins by getting network information based on the
  133. current drive letter. Once we have the network data and have built the new
  134. prompt string, we access the Master Environmet block and determine the 
  135. location of the 0x00 0x00 (end of env data) codes. We then search for the
  136. current location of the PROMPT= string and remove it by moving the rest
  137. of the env data into its location (packing.) The new prompt is annotated to
  138. the end of the data and terminating 0x00 0x00 codes are added.
  139.  
  140. The isr21 function then permits the DOS interrupt 19H call to continue.
  141.  
  142. That's It, Enjoy!
  143.  
  144.  
  145. Oh, yea, almost forgot the disclaimer (what a bunch of bother):    
  146.  
  147. The software and accompanying written materials (including instructions for 
  148. use) are provided "AS IS" without warranty of any kind. Further, I do not 
  149. warrant, guarantee, or make any representations regarding the use, or the 
  150. results of the use, of the software or written materials in terms of 
  151. correctness, accuracy, reliability, currentness, or otherwise. The entire 
  152. risk as to the result and performance of the program is assumed by you. If 
  153. the program or written materials are defective you, and not me, assume the 
  154. entire cost of all necessary servicing, repair, or correction.
  155.  
  156. No warranties of any kind, either express or implied, including but not 
  157. limited to the implied warranties of merchantability and fitness for a 
  158. particular purpose, that are made by me on this product. No oral or written 
  159. information or advice given by me shall create a warranty or in any way 
  160. increase the scope of this warranty, and you may not rely on any such
  161. information or advice. This warranty gives you specific legal rights. You 
  162. may have other legal rights, which vary from state to state.
  163.  
  164. Neither me or anyone else who has been involved with the creation, production, 
  165. or delivery of this program shall be liable for any direct, indirect,
  166. consequential, or incidental damages (including but not limited to damages 
  167. for loss of business profits, business interruption, loss of business 
  168. information, and the like) arising out of the use or inability to use such 
  169. product even if I have been advised of the possibility of such damages. 
  170. Because some states do not allow the exclusion or limitation of liability 
  171. for consequential or incidental damages, the above limitation may not apply 
  172. to you.
  173.  
  174. Trademarks: All trademarks and copyrights belong to their respective holders.
  175.  
  176.  
  177.